upgrade: Support --json and --json-error-messages and --json-progress
authorJoey Hess <joeyh@joeyh.name>
Wed, 10 May 2023 16:41:43 +0000 (12:41 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 10 May 2023 16:54:48 +0000 (12:54 -0400)
Seems unlikely to be very useful, but trivial.

Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
CHANGELOG
Command/Upgrade.hs
doc/git-annex-upgrade.mdwn
doc/todo/--json_for_unannex__and_ideally_any_other_command_.mdwn

index 72ef2198b4f7f269d215fcfb8d437ccca6a2b88a..e90bd1cd5eec3de8bdd49d5c900d630a541c9e1c 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -40,7 +40,8 @@ git-annex (10.20230408) UNRELEASED; urgency=medium
   * Support --json and --json-error-messages in more commands
     (addunused, dead, describe, dropunused, expire, fix, importfeed, init,
     log, merge, migrate, reinit, reinject, rekey, renameremote, rmurl,
-    semitrust, setpresentkey, trust, unannex, undo, untrust, unused)
+    semitrust, setpresentkey, trust, unannex, undo, untrust, unused,
+    upgrade)
   * log: When --raw-date is used, display only seconds from the epoch, as
     documented, omitting a trailing "s" that was included in the output
     before.
index 77f569a15bfe942653b3c82632cf88e442929d1e..31600fabecb9328ea4f5505612e5a827f861c29a 100644 (file)
@@ -20,6 +20,7 @@ cmd = dontCheck
        repoExists $
        -- avoid upgrading repo out from under daemon
        noDaemonRunning $
+       withAnnexOptions [jsonOptions] $
        command "upgrade" SectionMaintenance "upgrade repository"
                paramNothing (seek <$$> optParser)
 
index a74bfeb62365ef610a88beacbeb0f46830683e7d..0b22067816718ea64d666e3914e977bed6adf23a 100644 (file)
@@ -31,6 +31,16 @@ allow archives to be taken offline for years and later used.
   Only do whatever automatic upgrade can be done, don't necessarily
   upgrade to the latest version. This is used internally by git-annex.
 
+* `--json`
+
+  Enable JSON output. This is intended to be parsed by programs that use
+  git-annex.
+
+* `--json-error-messages`
+
+  Messages that would normally be output to standard error are included in
+  the JSON instead.
+
 * Also the [[git-annex-common-options]](1) can be used.
 
 # SEE ALSO
index 94f7552e2e8db647341170fe30869a3a2df973bb..e67a05daea27e9a23bdadfddfcd154b3156ebfdb 100644 (file)
@@ -38,13 +38,13 @@ These commands have been updated to support --json:
 * git-annex-renameremote
 * git-annex-importfeed
 * git-annex-merge
+* git-annex-upgrade
 
 Provisional list of commands that don't support --json and maybe should:
 
 * git-annex-configremote
 * git-annex-enableremote
 * git-annex-initremote
-* git-annex-upgrade
 
 These commands could support json, but I punted: